package pers.chao.logger;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import pers.chao.logger.properties.ColorfulLoggerProperties;
import pers.chao.logger.properties.LogbackLogbackProperties;
import pers.chao.tool.spring.BeansUtil;

/**
 * Description: 自定义logback#logger自动配置类
 *
 * @author W.Chao
 * @date 2020/11/21 19:21
 **/
@Configuration
@EnableConfigurationProperties({LogbackLogbackProperties.class, ColorfulLoggerProperties.class})
@ComponentScan("pers.chao.logger")
public class LogbackLoggerAutoConfigure {
	@Bean("beansUtil")
	public BeansUtil beansUtil() {
		return new BeansUtil();
	}

	@Bean("logbackLogbackProperties")
	public LogbackLogbackProperties logbackLogbackProperties(LogbackLogbackProperties logbackLogbackProperties) {
		return logbackLogbackProperties;
	}

	@Bean("colorfulLoggerProperties")
	public ColorfulLoggerProperties colorfulLoggerProperties(ColorfulLoggerProperties colorfulLoggerProperties) {
		return colorfulLoggerProperties;
	}

}
